home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 099 (1989-05-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 099 (1989-05-15)(Ossowski, Stefan)(DE)(PD).adf / PCQ / Runtime / writestring.asm < prev   
Assembly Source File  |  1989-03-31  |  493b  |  35 lines

  1.  
  2. *    WriteString.asm (of PCQ Pascal runtime library)
  3. *    Copyright (c) 1989 Patrick Quaid
  4.  
  5. *    Writes a string to a text file.
  6.  
  7.     SECTION    ONE
  8.  
  9.     XREF    _p%DOSBase
  10.     XREF    _LVOWrite
  11.     XREF    _p%padout
  12.     XDEF    _p%writestring
  13. _p%writestring
  14.  
  15.     move.l    d0,d2
  16.     move.l    d0,a0
  17.     move.l    6(sp),d1
  18.     move.l    #-1,d3
  19. 1$    addq.l    #1,d3        ; first find the length
  20. 2$    tst.b    0(a0,d3.l)
  21.     bne    1$
  22.     tst.l    d3
  23.     beq.s    3$
  24.     move.w    4(sp),d0
  25.     ext.l    d0
  26.     sub.l    d3,d0
  27.     ble.s    4$
  28.     jsr    _p%padout
  29. 4$    move.l    _p%DOSBase,a6
  30.     jsr    _LVOWrite(a6)
  31. 3$    rts
  32.  
  33.     END
  34.  
  35.